ActionController::Routing::Routes.draw do |map|
  map.root :controller => "category", :action => "all"

  map.connect '/admin', :controller => "admin/statistics", :action => "view"

  #map.connect '/ad/bid/:auction/:bid', :controller => 'ad', :action => 'bid'

  map.connect '/partial/browse', :controller => "category", :action => "all", :partial => "true"
  map.connect '/partial/searchbox', :controller => "search", :action => "view", :partial => "true"
  map.connect '/partial/search/:query', :controller => "search", :action => "query", :partial => "true"
  map.connect '/partial/quicksearch/', :controller => "search", :action => "quicksearch", :partial => "true"
  map.connect '/partial/quicksearch/:query', :controller => "search", :action => "quicksearch", :partial => "true"
  map.connect '/partial/browse/*category_path/:category', :controller => "category", :action => "show", :partial => "true"
  map.connect '/partial/search/:query/*category_path/:category', :controller => "search", :action => "query", :partial => "true"
  map.connect '/partial/quicksearch/:query/*category_path/:category', :controller => "search", :action => "quicksearch", :partial => "true"
  map.connect '/partial/:province_name/:province/browse', :controller => "category", :action => "show", :partial => "true"
  map.connect '/partial/:province_name/:province/search/:query', :controller => "search", :action => "query", :partial => "true"
  map.connect '/partial/:province_name/:province/quicksearch/:query', :controller => "search", :action => "query", :partial => "true"
  map.connect '/partial/:province_name/:province/browse/*category_path/:category', :controller => "category", :action => "show", :partial => "true"
  map.connect '/partial/:province_name/:province/search/:query/*category_path/:category', :controller => "search", :action => "query", :partial => "true"
  map.connect '/partial/:province_name/:province/quicksearch/:query/*category_path/:category', :controller => "search", :action => "quicksearch", :partial => "true"
  map.connect '/partial/:province_name/:province/:county_name/:county/browse', :controller => "category", :action => "show", :partial => "true"
  map.connect '/partial/:province_name/:province/:county_name/:county/search/:query', :controller => "search", :action => "query", :partial => "true"
  map.connect '/partial/:province_name/:province/:county_name/:county/quicksearch/:query', :controller => "search", :action => "quicksearch", :partial => "true"
  map.connect '/partial/:province_name/:province/:county_name/:county/browse/*category_path/:category', :controller => "category", :action => "show", :partial => "true"
  map.connect '/partial/:province_name/:province/:county_name/:county/search/:query/*category_path/:category', :controller => "search", :action => "query", :partial => "true"
  map.connect '/partial/:province_name/:province/:county_name/:county/quicksearch/:query/*category_path/:category', :controller => "search", :action => "quicksearch", :partial => "true"

  map.connect '/partial/:controller/:action/:id', :partial => "true"
  map.connect '/partial/:controller/:action/:id.:format', :partial => "true"

  map.connect '/partial/:id', :controller => "ad", :action => "view", :partial => "true"



  map.connect '/browse', :controller => "category", :action => "all"
  map.connect '/searchbox', :controller => "search", :action => "view"
  map.connect '/search/:query', :controller => "search", :action => "query"
  map.connect '/quicksearch/', :controller => "search", :action => "quicksearch"
  map.connect '/quicksearch/:query', :controller => "search", :action => "quicksearch"
  map.connect '/browse/*category_path/:category', :controller => "category", :action => "show"
  map.connect '/search/:query/*category_path/:category', :controller => "search", :action => "query"
  map.connect '/quicksearch/:query/*category_path/:category', :controller => "search", :action => "quicksearch"
  map.connect '/:province_name/:province/browse', :controller => "category", :action => "show"
  map.connect '/:province_name/:province/search/:query', :controller => "search", :action => "query"
  map.connect '/:province_name/:province/quicksearch/:query', :controller => "search", :action => "query"
  map.connect '/:province_name/:province/browse/*category_path/:category', :controller => "category", :action => "show"
  map.connect '/:province_name/:province/search/:query/*category_path/:category', :controller => "search", :action => "query"
  map.connect '/:province_name/:province/quicksearch/:query/*category_path/:category', :controller => "search", :action => "quicksearch"
  map.connect '/:province_name/:province/:county_name/:county/browse', :controller => "category", :action => "show"
  map.connect '/:province_name/:province/:county_name/:county/search/:query', :controller => "search", :action => "query"
  map.connect '/:province_name/:province/:county_name/:county/quicksearch/:query', :controller => "search", :action => "quicksearch"
  map.connect '/:province_name/:province/:county_name/:county/browse/*category_path/:category', :controller => "category", :action => "show"
  map.connect '/:province_name/:province/:county_name/:county/search/:query/*category_path/:category', :controller => "search", :action => "query"
  map.connect '/:province_name/:province/:county_name/:county/quicksearch/:query/*category_path/:category', :controller => "search", :action => "quicksearch"

  map.connect '/:controller/:action/:id'
  map.connect '/:controller/:action/:id.:format'

  map.connect '/:id', :controller => "ad", :action => "view"

end
